// File generated with Tower of Babel version: 5.3-beta on 09/05/17
var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var fan;
(function (fan) {
    var _B = BABYLON;
    var _M = _B.Matrix.FromValues;
    var _Q = _B.Quaternion;
    var _V = _B.Vector3;
    function CONTIG(array, offset, begin, end) {
        for(var i = 0, len = 1 + end - begin; i < len; i++) {
            array[offset + i] = begin + i;
        }
    }
    function REPEAT(array, offset, nRepeats, val) {
        for(var i = 0; i < nRepeats; i++) {
            array[offset + i] = val;
        }
    }
    var _sceneTransitionName;
    var _overriddenMillis;
    var _overriddenSound;
    var _options;

    function initScene(scene, resourcesRootDir, positionOffset, sceneTransitionName, overriddenMillis, overriddenSound, options) {
        if (!resourcesRootDir) { resourcesRootDir = "./"; }
        function MOVE(mesh, positionOffset) {
            mesh.position.addInPlace(positionOffset);
            if (mesh.isWorldMatrixFrozen) mesh.freezeWorldMatrix();
        }

        _sceneTransitionName = sceneTransitionName;
        _overriddenMillis    = overriddenMillis;
        _overriddenSound     = overriddenSound;
        _options             = options;

        scene.autoClear = true;
        scene.clearColor    = new _B.Color3(.0509,.0509,.0509);
        scene.ambientColor  = new _B.Color3(0,0,0);
        scene.gravity = new _V(0,-9.81,0);

        // define materials before meshes
        defineMaterials(scene, resourcesRootDir);

        // instance all root meshes
        var mesh;
        mesh = new rbpHole("rbpHole", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new bigbox("bigbox", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new rbp("rbp", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new dummy("dummy", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new fanTray("fanTray", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new fanTray0("fanTray0", scene);
        if (positionOffset) MOVE(mesh, positionOffset);
        mesh = new fanCage("fanCage", scene);
        if (positionOffset) MOVE(mesh, positionOffset);

        if (sceneTransitionName && matLoaded) {
            QI.SceneTransition.perform(sceneTransitionName, waitingMeshes, overriddenMillis, overriddenSound, options);
        }
    }
    fan.initScene = initScene;

    var waitingMeshes = [];
    var pendingTextures = 0;
    var texLoadStart = 0;
    function onTexturesLoaded(){
        if (--pendingTextures > 0) return;
        _B.Tools.Log("Texture Load delay:  " + ((_B.Tools.Now - texLoadStart) / 1000).toFixed(2) + " secs");
        if (_sceneTransitionName) QI.SceneTransition.perform(_sceneTransitionName, waitingMeshes, _overriddenMillis, _overriddenSound, _options);
        else {
            for (var i = 0, len = waitingMeshes.length; i < len; i++) {
                if (!waitingMeshes[i].initComplete) continue;
                if (typeof waitingMeshes[i].grandEntrance == "function") waitingMeshes[i].grandEntrance();
                else makeVisible(waitingMeshes[i]);
            }
        }
        waitingMeshes = [];
        _sceneTransitionName = null;
        matLoaded = true;
    }

    // QI.Mesh has similar method, using this to not require QI
    function makeVisible(mesh){
        var children = mesh.getChildMeshes();
        mesh.isVisible = true;
        for (var i = 0, len = children.length; i < len; i++) {
            children[i].isVisible = true;
        }
    }

    var aheadQueued = false;
    function matReadAhead(materialsRootDir) {
        if (aheadQueued) return;
        var txBuffer;
        var fName;

        aheadQueued = true;
    }
    fan.matReadAhead = matReadAhead;

    var matLoaded = false;
    function defineMaterials(scene, materialsRootDir) {
        if (!materialsRootDir) { materialsRootDir = "./"; }
        if (materialsRootDir.lastIndexOf("/") + 1  !== materialsRootDir.length) { materialsRootDir  += "/"; }
        if (typeof(QI) !== "undefined") QI.TimelineControl.initialize(scene);
        if (typeof(TOWER_OF_BABEL) !== "undefined") TOWER_OF_BABEL.Preloader.SCENE = scene;
        var loadStart = _B.Tools.Now;
        matReadAhead(materialsRootDir);
        var material;
        var texture;
        var txBuffer;

        material = scene.getMaterialByID("fan.Material.001");
        if (!material){
            material = new _B.StandardMaterial("fan.Material.001", scene);
            material.ambientColor  = new _B.Color3(.8,.8,.8);
            material.diffuseColor  = new _B.Color3(.24,.24,.24);
            material.emissiveColor = new _B.Color3(0,0,0);
            material.specularColor = new _B.Color3(.16,.16,.16);
            material.specularPower = 50;
            material.alpha =  1;
            material.backFaceCulling = true;
            material.checkReadyOnlyOnce = false;
            material.maxSimultaneousLights = 4;
        } else material.markDirty();

        material = scene.getMaterialByID("fan.Material.002");
        if (!material){
            material = new _B.StandardMaterial("fan.Material.002", scene);
            material.ambientColor  = new _B.Color3(.8,.8,.8);
            material.diffuseColor  = new _B.Color3(.24,.24,.24);
            material.emissiveColor = new _B.Color3(0,0,0);
            material.specularColor = new _B.Color3(.16,.16,.16);
            material.specularPower = 50;
            material.alpha =  1;
            material.backFaceCulling = true;
            material.checkReadyOnlyOnce = false;
            material.maxSimultaneousLights = 4;
        } else material.markDirty();

        matLoaded = pendingTextures === 0;
        if (!matLoaded) texLoadStart = _B.Tools.Now;
        _B.Tools.Log("fan.defineMaterials completed:  " + ((_B.Tools.Now - loadStart) / 1000).toFixed(2) + " secs");
    }
    fan.defineMaterials = defineMaterials;

    var rbpHole = (function (_super) {
        __extends(rbpHole, _super);
        function rbpHole(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = -264.07;
            this.position.y  = 0;
            this.position.z  = -75.2;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -13.2,93,-100.2,-13.2,-93,100.2,-13.2,-93,-100.2,13.2,93,100.2,13.2,-93,-100.2,13.2,-93,100.2,13.2,93,-100.2,-13.2,93,100.2
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,5,6,2,4,5,2,1,7,6,3,0,7,1,3,6,4,6,0,2,5,4,2,7,0,6]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.7071,-.7071,0,-.5773,-.5773,-.5773,.7071,.7071,0,.5773,-.5773,-.5773,.7071,-.7071,0,.5773,.5773,-.5773,-.7071,.7071,0
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 8, 0, 30, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        rbpHole.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return rbpHole;
    })(BABYLON.Mesh);
    fan.rbpHole = rbpHole;

    var bigbox = (function (_super) {
        __extends(bigbox, _super);
        function bigbox(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = 0;
            this.position.y  = 265.7252;
            this.position.z  = 0;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -277.27,93,-25,-277.27,-93,25,-277.27,-93,-25,-277.27,93,25,277.27,-93,25,277.27,93,25,277.27,-93,-25,277.27,93,-25
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,1,5,6,4,7,2,6,4,2,1,3,7,5,0,3,1,3,5,4,5,7,6,7,0,2,4,6,2,3,0,7]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.5773,-.5773,.5773,-.5773,-.5773,-.5773,-.5773,.5773,.5773,.5773,-.5773,.5773,.5773,.5773,.5773,.5773,-.5773,-.5773,.5773,.5773,-.5773
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 8, 0, 36, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        bigbox.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return bigbox;
    })(BABYLON.Mesh);
    fan.bigbox = bigbox;

    var rbp = (function (_super) {
        __extends(rbp, _super);
        function rbp(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = -264.07;
            this.position.y  = 0;
            this.position.z  = -75.2;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -13.2,93,-100.2,-13.2,-93,100.2,-13.2,-93,-100.2,-13.2,93,100.2,13.2,-93,100.2,13.2,93,100.2,13.2,-93,-100.2,13.2,93,-100.2
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,1,5,6,4,7,2,6,4,2,1,3,7,5,0,3,1,3,5,4,5,7,6,7,0,2,4,6,2,3,0,7]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.5773,-.5773,.5773,-.5773,-.5773,-.5773,-.5773,.5773,.5773,.5773,-.5773,.5773,.5773,.5773,.5773,.5773,-.5773,-.5773,.5773,.5773,-.5773
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 8, 0, 36, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        rbp.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return rbp;
    })(BABYLON.Mesh);
    fan.rbp = rbp;

    var dummy = (function (_super) {
        __extends(dummy, _super);
        function dummy(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = -217.5;
            this.position.y  = 0;
            this.position.z  = 0;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -32.4489,93,-25,-32.4489,-93,25,-32.4489,-93,-25,-32.4489,93,25,23.8395,-93,25,23.8395,93,25,23.8395,-93,-25,23.8395,93,-25
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,1,5,6,4,7,2,6,4,2,1,3,7,5,0,3,1,3,5,4,5,7,6,7,0,2,4,6,2,3,0,7]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.5773,-.5773,.5773,-.5773,-.5773,-.5773,-.5773,.5773,.5773,.5773,-.5773,.5773,.5773,.5773,.5773,.5773,-.5773,-.5773,.5773,.5773,-.5773
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 8, 0, 36, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        dummy.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return dummy;
    })(BABYLON.Mesh);
    fan.dummy = dummy;

    var fanTray = (function (_super) {
        __extends(fanTray, _super);
        function fanTray(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = 42.27;
            this.position.y  = 0;
            this.position.z  = 0;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -235,93,-25,-235,-93,25,-235,-93,-25,72,-70,25,212,-70,25,235,-93,25,235,93,25,235,-93,-25,72,-70,-25,70,-70,-25,-235,93,25,235,93,-25,70,-23.4789,-25,70,70,-25,70,23.4789,25,-70,-70,25,-70,70,-25
                    ,-70,-70,-25,-70,70,25,-72,70,25,-72,-70,-25,70,-70,25,70,70,25,212,-70,-25,212,70,25,72,24.1498,25,72,70,-25,72,-24.1497,-25,208.6978,-70,-25,72,70,25,208.6978,70,25,-72,-68.4272,-25,-72,70,-25,-72,-68.4272,25
                    ,-212,-70,25,-212,70,-25,-212,-70,-25,-72,-70,25,-212,70,25,212,70,-25
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,5,6,7,5,8,9,7,5,2,1,10,11,6,12,13,14,15,16,17,18,19,10,2,17,20,17,21,15,13,18,22,23,24,4,25,26,27,28,23,4,26,29,30,31,32
                ,33,34,35,36,13,26,11,1,37,15,34,20,37,32,38,19,0,10,1,5,1,15,21,14,3,5,15,21,24,30,6,4,24,6,14,25,3,4,6,5,5,21,3,6,11,7,2,7,9,8
                ,27,9,7,28,8,9,17,2,27,12,9,5,7,2,10,0,11,14,21,12,9,12,21,13,22,14,15,18,16,10,6,22,29,25,22,6,30,29,34,1,10,38,34,10,25,14,22,18,15,33
                ,6,29,22,18,33,19,10,22,18,19,38,10,17,31,20,20,36,2,17,9,21,13,16,18,23,39,24,27,8,3,25,29,26,27,3,25,4,3,28,8,28,3,30,24,39,39,26,30,33,37
                ,20,20,31,33,32,19,33,34,38,35,2,36,35,32,31,16,0,2,35,31,17,16,0,35,32,23,28,7,39,23,7,11,0,13,32,16,0,39,7,11,12,27,26,26,39,11,0,16,13,13
                ,12,26,1,34,37,37,33,15,34,36,20,32,35,38]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.5773,-.5773,.5773,-.5773,-.5773,-.5773,.3015,.3015,.9045,-.3015,.3015,.9045,.5773,-.5773,.5773,.5773,.5773,.5773,.5773,-.5773,-.5773,.3015,.3015,-.9045,-.3015,.3015,-.9045,-.5773,.5773,.5773,.5773,.5773,-.5773,-.7071,0,-.7071,-.3015,-.3015,-.9045,-.7071,0,.7071,.3015,.3015,.9045,.3015,-.3015,-.9045
                    ,.3015,.3015,-.9045,.3015,-.3015,.9045,-.3015,-.3015,.9045,-.3015,.3015,-.9045,-.3015,.3015,.9045,-.3015,-.3015,.9045,-.3015,.3015,-.9045,-.3015,-.3015,.9045,.7071,0,.7071,.3015,-.3015,-.9045,.7071,0,-.7071,0,.7071,-.7071,.3015,-.3015,.9045,0,-.7071,.7071,-.7071,0,-.7071,-.3015,-.3015,-.9045,-.7071,0,.7071
                    ,.3015,.3015,.9045,.3015,-.3015,-.9045,.3015,.3015,-.9045,-.3015,.3015,.9045,.3015,-.3015,.9045,-.3015,-.3015,-.9045
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 40, 0, 264, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        fanTray.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return fanTray;
    })(BABYLON.Mesh);
    fan.fanTray = fanTray;

    var fanTray0 = (function (_super) {
        __extends(fanTray0, _super);
        function fanTray0(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = 818.7965;
            this.position.y  = 816.5812;
            this.position.z  = 0;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    -277.27,93,-25,-277.27,-93,25,-277.27,-93,-25,238.5,-71,25,238.5,70.5979,25,277.27,-93,25,277.27,93,25,277.27,-93,-25,71,-71,-25,-71,-71,-25,-277.27,93,25,277.27,93,-25,71,71,25,71,-71,25,-71,-71,25,-71,71,-25,-238.5,71,25
                    ,-238.5,-70.5979,25,-96.5,-71,-25,-238.5,-71,-25,71,71,-25,-71,71,25,238.5,-70.5979,-25,238.5,71,-25,96.5,-71,25,96.5,71,-25,96.5,-71,-25,96.5,71,25,238.5,71,25,-96.5,71,25,-96.5,-71,25,-238.5,71,-25,-238.5,70.5979,-25,-238.5,-71,25
                    ,-96.5,71,-25,238.5,-71,-25
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,5,6,7,5,7,8,9,5,2,1,10,11,6,8,12,13,14,15,9,16,17,10,2,18,19,9,13,14,20,21,12,22,23,4,24,25,26,6,27,12,23,11,25,26,3
                ,24,23,27,28,18,29,30,16,31,32,0,15,20,1,30,14,19,30,33,34,16,29,0,10,1,5,1,14,13,24,5,5,14,13,4,6,5,5,24,3,6,11,7,7,22,35,26,8,7,7
                ,35,26,9,2,7,5,7,2,10,0,11,8,20,12,14,21,15,10,6,12,21,29,10,10,12,21,17,1,10,10,29,16,9,15,34,9,34,18,32,0,2,9,18,2,19,32,2,9,8,13
                ,20,15,21,4,3,22,35,22,3,23,28,4,24,27,25,6,4,28,27,24,13,6,28,27,27,13,12,20,8,26,20,26,25,22,7,11,20,25,11,23,22,11,26,35,3,23,25,27,18,34
                ,29,32,19,17,17,16,32,19,33,17,0,32,31,34,15,0,0,31,34,20,11,0,1,17,33,30,29,21,1,33,30,30,21,14,19,18,30,34,31,16]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    -.5773,.5773,-.5773,-.5773,-.5773,.5773,-.5773,-.5773,-.5773,-.3015,.3015,.9045,-.7071,0,.7071,.5773,-.5773,.5773,.5773,.5773,.5773,.5773,-.5773,-.5773,-.3015,.3015,-.9045,.3015,.3015,-.9045,-.5773,.5773,.5773,.5773,.5773,-.5773,-.3015,-.3015,.9045,-.3015,.3015,.9045,.3015,.3015,.9045,.3015,-.3015,-.9045,.3015,-.3015,.9045
                    ,.7071,0,.7071,-.3015,.3015,-.9045,.3015,.3015,-.9045,-.3015,-.3015,-.9045,.3015,-.3015,.9045,-.7071,0,-.7071,-.3015,-.3015,-.9045,.3015,.3015,.9045,.3015,-.3015,-.9045,.3015,.3015,-.9045,.3015,-.3015,.9045,-.3015,-.3015,.9045,-.3015,-.3015,.9045,-.3015,.3015,.9045,.3015,-.3015,-.9045,.7071,0,-.7071,.3015,.3015,.9045
                    ,-.3015,-.3015,-.9045,-.3015,.3015,-.9045
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.setMaterialByID("fan.Material.001");
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 36, 0, 240, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        fanTray0.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return fanTray0;
    })(BABYLON.Mesh);
    fan.fanTray0 = fanTray0;

    var fanCage = (function (_super) {
        __extends(fanCage, _super);
        function fanCage(name, scene, materialsRootDir, source) {
            _super.call(this, name, scene, null, source, true);

            if (!materialsRootDir) { materialsRootDir = "./"; }
            defineMaterials(scene, materialsRootDir); //embedded version check
            var cloning = source && source !== null;
            var load = _B.Tools.Now;
            var geo = 0;
            var shape = 0;
            this.position.x  = 0;
            this.position.y  = 0;
            this.position.z  = 0;
            this.rotation.x  = 0;
            this.rotation.y  = 0;
            this.rotation.z  = 0;
            this.scaling.x   = 1;
            this.scaling.y   = 1;
            this.scaling.z   = 1;
            this.fanRotor = cloning ? child_fanRotor(scene, this, source.fanRotor) : child_fanRotor(scene, this);

            this.id = this.name;
            this.billboardMode  = 0;
            this.isVisible  = false; //always false; evaluated again at bottom
            this.setEnabled(true);
            this.checkCollisions = false;
            this.receiveShadows  = false;
            this.castShadows  = false;
            this.initComplete = false;
            if (!cloning){
                geo = _B.Tools.Now;
                this.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                    70,-70,-19,-70,-70,19,70,-70,19,-70,70,19,70,70,-19,70,70,19,0,-65,-19,-70,-70,-19,-70,70,-19,0,65,19,-12.6808,63.7511,19,63.751,-12.6809,-19,65,0,19,63.751,-12.6809,19,45.9619,-45.9619,-19,54.0455,-36.1121,19,45.9619,-45.9619,19
                    ,60.0522,-24.8744,-19,60.0522,-24.8744,19,-63.751,12.6809,-19,-65,.0001,19,-63.751,12.6809,19,63.751,12.6809,-19,60.0522,24.8744,19,63.751,12.6809,19,65,0,-19,54.0455,36.1121,-19,45.9619,45.9619,19,54.0455,36.1121,19,0,65,-19,-12.6809,-63.751,-19,0,-65,19,-12.6809,-63.751,19,-54.0455,36.1121,-19
                    ,-60.0521,24.8745,19,-54.0455,36.1121,19,12.6809,-63.751,19,-12.6808,63.7511,-19,-24.8743,60.0522,19,45.9619,45.9619,-19,36.1121,54.0455,19,-36.1121,-54.0455,-19,-24.8745,-60.0522,19,-36.1121,-54.0455,19,36.1121,54.0455,-19,24.8744,60.0522,19,36.1121,-54.0455,-19,36.1121,-54.0455,19,-36.112,54.0456,-19,-45.9619,45.962,19,-36.112,54.0456,19
                    ,-60.0521,24.8745,-19,24.8744,-60.0522,-19,24.8744,-60.0522,19,-45.962,-45.9619,-19,-45.962,-45.9619,19,-60.0522,-24.8744,-19,-54.0455,-36.112,19,-60.0522,-24.8744,19,12.6809,63.751,-19,12.6809,63.751,19,60.0522,24.8744,-19,-65,.0001,-19,-63.7511,-12.6808,19,-24.8745,-60.0522,-19,-24.8743,60.0522,-19,24.8744,60.0522,-19,-63.7511,-12.6808,-19
                    ,-45.9619,45.962,-19,54.0455,-36.1121,-19,-54.0456,-36.112,-19,12.6809,-63.751,-19
                ]),
                false);

                var _i;//indices & affected indices for shapekeys
                _i = new Uint32Array([0,1,2,3,4,5,5,0,2,0,6,7,8,1,7,9,10,3,11,12,13,14,15,16,15,17,18,19,20,21,22,23,24,25,24,12,26,27,28,29,10,9,30,31,32,33,34,35,6,36
                ,31,37,38,10,39,40,27,41,42,43,44,45,40,46,16,47,48,49,50,51,21,34,52,47,53,54,43,55,56,57,58,59,9,60,61,28,23,62,63,20,17,13,18,64,32,42,29,59,4,65
                ,50,38,66,60,45,36,52,53,67,58,63,68,35,49,31,2,1,57,54,55,0,7,1,3,8,4,5,4,0,0,4,25,0,25,11,62,8,7,67,62,7,0,11,17,0,17,69,56,67,7
                ,70,56,7,0,69,14,0,14,46,54,70,7,41,54,7,0,46,52,0,52,71,64,41,7,30,64,7,0,71,6,6,30,7,8,3,1,5,12,24,5,24,23,21,20,3,34,21,3,5,23
                ,28,5,28,27,35,34,3,49,35,3,5,27,40,5,40,45,50,49,3,38,50,3,5,45,60,5,60,9,10,38,3,3,5,9,11,25,12,14,69,15,15,69,17,19,62,20,22,61,23,25
                ,22,24,26,39,27,29,37,10,30,6,31,33,51,34,6,71,36,37,65,38,39,44,40,41,64,42,44,66,45,46,14,16,48,68,49,51,19,21,52,46,47,54,41,43,56,70,57,59,29,9
                ,61,26,28,62,67,63,17,11,13,64,30,32,8,62,19,8,19,51,22,25,4,61,22,4,8,51,33,8,33,68,26,61,4,39,26,4,8,68,48,8,48,65,44,39,4,66,44,4,8,65
                ,37,8,37,29,59,66,4,4,8,29,65,48,50,66,59,60,36,71,52,67,56,58,68,33,35,1,3,20,1,20,63,12,5,2,13,12,2,1,63,58,1,58,57,18,13,2,15,18,2,1
                ,57,55,1,55,43,16,15,2,47,16,2,1,43,42,1,42,32,53,47,2,36,53,2,1,32,31,31,36,2,57,70,54]);
                this.setIndices(_i);

                this.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                    .5773,-.5773,-.5773,-.5773,-.5773,.5773,.5773,-.5773,.5773,-.5773,.5773,.5773,.5773,.5773,-.5773,.5773,.5773,.5773,0,.6836,-.7298,-.5773,-.5773,-.5773,-.5773,.5773,-.5773,0,-.6836,.7298,.1333,-.6705,.7298,-.6705,.1333,-.7298,-.6836,0,.7298,-.6705,.1333,.7298,-.4834,.4834,-.7298,-.5684,.3798,.7298,-.4834,.4834,.7298
                    ,-.6316,.2616,-.7298,-.6316,.2616,.7298,.6705,-.1334,-.7298,.6836,0,.7298,.6705,-.1334,.7298,-.6705,-.1333,-.7298,-.6316,-.2616,.7298,-.6705,-.1333,.7298,-.6836,0,-.7298,-.5684,-.3798,-.7298,-.4834,-.4834,.7298,-.5684,-.3798,.7298,0,-.6836,-.7298,.1333,.6705,-.7298,0,.6836,.7298,.1333,.6705,.7298,.5684,-.3798,-.7298
                    ,.6316,-.2616,.7298,.5684,-.3798,.7298,-.1333,.6705,.7298,.1333,-.6705,-.7298,.2616,-.6316,.7298,-.4834,-.4834,-.7298,-.3798,-.5684,.7298,.3798,.5684,-.7298,.2616,.6316,.7298,.3798,.5684,.7298,-.3798,-.5684,-.7298,-.2616,-.6316,.7298,-.3798,.5684,-.7298,-.3798,.5684,.7298,.3798,-.5684,-.7298,.4834,-.4834,.7298,.3798,-.5684,.7298
                    ,.6316,-.2616,-.7298,-.2616,.6316,-.7298,-.2616,.6316,.7298,.4834,.4834,-.7298,.4834,.4834,.7298,.6316,.2616,-.7298,.5684,.3798,.7298,.6316,.2616,.7298,-.1333,-.6705,-.7298,-.1333,-.6705,.7298,-.6316,-.2616,-.7298,.6836,0,-.7298,.6705,.1333,.7298,.2616,.6316,-.7298,.2616,-.6316,-.7298,-.2616,-.6316,-.7298,.6705,.1333,-.7298
                    ,.4834,-.4834,-.7298,-.5684,.3798,-.7298,.5684,.3798,-.7298,-.1333,.6705,-.7298
                ]),
                false);

                geo = (_B.Tools.Now - geo) / 1000;
                this.setMaterialByID("fan.Material.001");
                this.subMeshes = [];
                new _B.SubMesh(0, 0, 72, 0, 432, this);
                if (scene._selectionOctree) {
                    scene.createOrUpdateSelectionOctree();
                }
            }
            if (this.postConstruction) this.postConstruction();
            this.initComplete = true;
            load = (_B.Tools.Now - load) / 1000;
            _B.Tools.Log("defined mesh: " + this.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
            if (matLoaded && !_sceneTransitionName){
                if (typeof this.grandEntrance == "function") this.grandEntrance();
                else makeVisible(this);

            } else waitingMeshes.push(this);
        }

        fanCage.prototype.dispose = function (doNotRecurse) {
            _super.prototype.dispose.call(this, doNotRecurse);
            if (this.skeleton) this.skeleton.dispose();
        };
        return fanCage;
    })(BABYLON.Mesh);
    fan.fanCage = fanCage;

    function child_fanRotor(scene, parent, source){
        var ret = new BABYLON.Mesh(parent.name + ".fanRotor", scene, parent, source);
        var cloning = source && source !== null;
        var load = _B.Tools.Now;
        var geo = 0;
        var shape = 0;
        ret.position.x  = 0;
        ret.position.y  = 0;
        ret.position.z  = 0;
        ret.rotation.x  = -1.5708;
        ret.rotation.y  = 0;
        ret.rotation.z  = 0;
        ret.scaling.x   = 1;
        ret.scaling.y   = 1;
        ret.scaling.z   = 1;

        ret.id = ret.name;
        ret.billboardMode  = 0;
        ret.isVisible  = false; //always false; evaluated again at bottom
        ret.setEnabled(true);
        ret.checkCollisions = false;
        ret.receiveShadows  = false;
        ret.castShadows  = false;
        ret.initComplete = false;
        if (!cloning){
            geo = _B.Tools.Now;
            ret.setVerticesData(_B.VertexBuffer.PositionKind, new Float32Array([
                27.2076,-18,-15.7083,18.4662,18,-25.4166,27.2076,-18,-15.7083,-31.2445,18,-3.2839,6.5319,18,-30.7301,-23.3471,18,21.0218,6.5319,-18,-30.7301,-18.4662,-18,-25.4166,23.3471,-18,21.0218,37.0305,18,-50.9681,54.5596,-18,-31.5,37.0305,18,-50.9681,46.8181,-18,42.1552,23.3471,-18,21.0218,46.8181,-18,42.1552,-29.879,18,9.7083,-31.2445,-18,-3.2839
                ,-29.879,18,9.7083,59.9166,18,19.4681,59.9166,18,19.4681,31.2445,18,-3.2839,31.2445,-18,-3.2839,29.879,-18,9.7083,27.2076,18,-15.7083,29.879,18,9.7083,23.3471,18,21.0218,12.7783,18,28.7005,12.7783,-18,28.7005,0,-18,31.4166,0,18,31.4166,-12.7783,-18,28.7005,18.4662,18,-25.4166,18.4662,-18,-25.4166,-6.5319,18,-30.7301
                ,-6.5319,-18,-30.7301,-18.4662,18,-25.4166,-27.2076,18,-15.7083,-27.2076,-18,-15.7083,-31.2445,-18,-3.2839,-29.879,-18,9.7083,-23.3471,-18,21.0218,-12.7783,18,28.7005,54.5596,-18,-31.5,37.0305,18,-50.9681,23.3471,-18,21.0218,46.8181,-18,42.1552,-31.2445,-18,-3.2839,-29.879,18,9.7083,59.9166,18,19.4681,0,18,63,0,18,31.4166
                ,0,18,63,29.879,18,9.7083,-6.5319,-18,-30.7301,-18.4662,18,-25.4166,-59.9166,18,19.4681,-59.9166,18,19.4681,54.5596,-18,-31.5,-25.6244,-18,57.5534,-12.7783,-18,28.7005,-13.0984,-18,-61.6233,-37.0305,18,-50.9681,-13.0984,-18,-61.6233,-62.6549,-18,-6.5853,-62.6549,-18,-6.5853,-37.0305,18,-50.9681,0,18,31.4166,-25.6244,-18,57.5534
                ,0,18,63,28.3825,-17.0425,-14.4034,55.7345,-17.0425,-30.1951,-59.9166,18,19.4681,-29.6954,17.0425,11.4546,-59.733,17.0425,21.2144,-6.5319,-18,-30.7301,-20.0703,17.0425,-24.7024,-18.4662,18,-25.4166,29.879,18,9.7083,59.0386,18.9575,20.9887,29.001,18.9575,11.2289,18.4662,18,-25.4166,27.2076,-18,-15.7083,-25.6244,-18,57.5534,-12.7783,-18,28.7005,-37.0305,18,-50.9681
                ,-13.0984,-18,-61.6233,-62.6549,-18,-6.5853,-11.0607,-18.9575,29.0656,1.7175,17.0425,63.3651,1.7175,17.0425,31.7817,22.4691,-17.0425,22.5425,-31.0609,-18.9575,-1.5376,-62.4713,-18.9575,-4.839,38.2054,18.9575,-49.6632,-38.6346,17.0425,-50.2539,-8.136,-18.9575,-30.0159,-14.7026,-18.9575,-60.9091,-23.9069,-18.9575,57.9184,19.6411,18.9575,-24.1117,45.9402,-17.0425,43.6759
            ]),
            false);

            var _i;//indices & affected indices for shapekeys
            _i = new Uint32Array(588);
            CONTIG(_i, 0, 0, 18);
            _i.set([14,19,20,21,22,23,0,21,24,22,20,8,25,24,26,27,28,29,28,30,31,32,0,4,6,32,33,34,6,35,7,34,36,37,7,3,38,37,15,39,38,5,40,39,41,30,40,11,42,43
            ,14,44,45,17,46,47,19,45,48,49,50,51,24,19,52,35,53,54,55,17,56,57,2,10,30,58,59,31,11,1,60,61,62,8,52,13,34,62,53,63,56,64,65,54,61,29,59,66,67,49
            ,58,38,64,16,68,66,49,42], 19);
            CONTIG(_i, 127, 69, 80);
            _i.set([69,81,2,80,81,52,48,77,54,74,76,56,47,71,10,81,42,59,82,83,1,43,80,62,84,85,53,85,74,13,77,44,64,71,86,61,76,84,66,83,50,58,51,82,16,86,46,87,88,89
            ,78,90,79,73,91,92,69,93,70,94,95,96,83,97,87,80,93,98,84,96,85,74,96,95,77,90,44,71,92,86,84,75,94,83,89,50,51,97,82,46,92,91,51,89,88,45,78,48,46,72
            ,47,45,90,99,42,93,43,76,85,74,43,81,42,77,45,48,83,51,82,47,86,46,0,31,1,25,26,29,29,41,5,5,15,3,3,36,4,35,33,4,4,31,24,23,20,24,24,25,29,29
            ,5,24,36,35,4,31,23,24,24,5,4,30,28,40,27,8,7,22,21,0,0,32,6,6,34,7,7,37,40,38,39,40,40,28,27,8,22,6,0,6,22,37,38,40,40,27,7,9,57,10
            ,12,8,13,15,38,16,18,12,14,20,23,21,23,31,0,24,8,22,8,27,25,26,25,27,29,26,28,31,4,32,4,33,6,33,35,34,35,36,7,36,3,37,3,15,38,15,5,39,5,41
            ,40,41,29,30,11,10,42,14,13,44,17,16,46,19,14,45,49,66,50,24,18,19,35,34,53,55,15,17,57,0,2,30,67,58,31,9,11,60,65,61,8,24,52,34,60,62,63,55,56,65
            ,35,54,29,30,59,67,68,49,38,63,64,68,29,66,42,81,69,71,47,72,74,95,75,77,48,78,80,98,69,2,1,80,52,19,48,54,53,74,56,17,47,10,2,81,59,58,82,1,11,43
            ,62,61,84,53,62,85,13,52,77,64,56,71,61,54,76,66,59,83,58,49,51,16,64,86,87,97,88,78,99,90,73,72,91,69,98,93,94,75,95,83,82,97,80,43,93,84,94,96,74,85
            ,96,77,79,90,71,73,92,84,76,75,83,87,89,51,88,97,46,86,92,51,50,89,45,99,78,46,91,72,45,44,90,42,70,93,76,84,85,43,80,81,77,44,45,83,50,51,47,71,86], 139);
            ret.setIndices(_i);

            ret.setVerticesData(_B.VertexBuffer.NormalKind, new Float32Array([
                .6482,-.6631,-.3742,.51,.4971,-.702,.7514,-.4971,-.4338,-.7443,.6631,-.0782,.1556,.6631,-.7321,-.5562,.6631,.5008,.1556,-.6631,-.7321,-.4399,-.6631,-.6055,.0581,-.9546,.2922,.5651,.2747,-.7779,.8327,-.2747,-.4808,.5651,.2747,-.7779,.7145,-.2747,.6434,.6448,-.4971,.5806,.7145,-.2747,.6434,-.7118,.6631,.2313,-.8629,-.4971,-.0907
                ,-.8252,.4971,.2681,.9145,.2747,.2971,.9145,.2747,.2971,.2188,.9546,-.2022,.7443,-.6631,-.0782,-.172,-.9546,-.2433,.6482,.6631,-.3742,-.2821,.9546,.0957,.5562,.6631,.5008,.3044,.6631,.6837,.3044,-.6631,.6837,0,-.6631,.7485,0,.6631,.7485,-.3044,-.6631,.6837,.4399,.6631,-.6055,.4399,-.6631,-.6055,-.1556,.6631,-.7321
                ,-.1556,-.6631,-.7321,-.4399,.6631,-.6055,-.6482,.6631,-.3742,-.6482,-.6631,-.3742,-.7443,-.6631,-.0782,-.7118,-.6631,.2313,-.5562,-.6631,.5008,-.3044,.6631,.6837,.37,-.7971,-.4771,-.1605,.2306,-.9597,-.2791,-.7605,-.5863,.5823,-.8005,.1418,.5811,-.2909,-.76,.5374,.7671,-.3502,.8542,.1744,-.4897,0,.2747,.9615,-.249,.7605,-.5997
                ,-.2842,.8005,.5276,.8252,.4971,.2681,-.1804,-.4971,-.8487,-.51,.4971,-.702,-.9145,.2747,.2971,-.9145,.2747,.2971,.8327,-.2747,-.4808,-.3911,-.2747,.8784,-.3529,-.4971,.7927,-.1999,-.2747,-.9405,-.5651,.2747,-.7779,-.1999,-.2747,-.9405,-.9562,-.2747,-.1005,-.9562,-.2747,-.1005,-.5651,.2747,-.7779,0,.4971,.8677,-.3911,-.2747,.8784
                ,0,.2747,.9615,.0239,-.2311,.9726,.9374,-.1744,.3014,-.6022,.7971,-.0443,.7264,.2909,.6226,-.4342,.2306,.8708,.9024,-.2909,.3178,-.3677,.2909,.8832,.4991,.7671,.4029,-.1788,.2311,-.9563,.4139,.8005,.4334,-.6473,.7605,.0515,-.9536,.2909,-.0767,-.6198,-.7671,.165,-.9355,-.1744,.3071,-.591,-.2311,-.7728,-.1439,.7971,-.5864
                ,.537,-.2306,-.8114,-.6058,-.2306,-.7615,.4044,-.7671,-.4978,.694,.2306,.6821,.8166,.2909,-.4984,-.9176,-.2311,.3233,.5985,-.7671,.2308,-.5798,-.7971,.1685,.5401,.8005,-.2597,-.9623,.2306,-.1439,-.0345,-.7671,.6405,-.3395,-.7971,-.4993,-.0189,-.7971,.6035,-.151,.7605,.6316,.003,-.1744,.9846
            ]),
            false);

            geo = (_B.Tools.Now - geo) / 1000;
            ret.setMaterialByID("fan.Material.002");
            ret.subMeshes = [];
            new _B.SubMesh(0, 0, 100, 0, 588, ret);
            if (scene._selectionOctree) {
                scene.createOrUpdateSelectionOctree();
            }
        }
        if (this.postConstruction) this.postConstruction();
        ret.initComplete = true;
        load = (_B.Tools.Now - load) / 1000;
        _B.Tools.Log("defined mesh: " + ret.name + (cloning ? " (cloned)" : "") + " completed:  " + load.toFixed(2) + ", geometry:  " + geo.toFixed(2) + ", skey:  " + shape.toFixed(2) + " secs");
        return ret;
    }

    function freshenShadowRenderLists(scene) {
        var renderList = [];
        for (var i = 0; i < scene.meshes.length; i++){
            if (scene.meshes[i]["castShadows"])
                renderList.push(scene.meshes[i]);
        }

        for (var i = 0; i < scene.lights.length; i++){
            if (scene.lights[i]._shadowGenerator)
                scene.lights[i]._shadowGenerator.getShadowMap().renderList = renderList;
        }
    }
    fan.freshenShadowRenderLists = freshenShadowRenderLists;
})(fan || (fan = {}));